package com.arsl.client.util;

import java.io.IOException;
import java.util.Properties;

import org.apache.ibatis.io.Resources;

public class PropertyManager {

	private static PropertyManager self = null;

	public static final String HOST_URL_KEY = "host_url";

	public String hostUrl;

	private PropertyManager() {
	}

	/**
	 * @return the hostUrl
	 */
	public String getHostUrl() {
		return hostUrl;
	}

	public static PropertyManager getInstance() {
		if (self == null) {
			self = new PropertyManager();
			self.initialize();
		}
		return self;
	}

	private void initialize() {
		Properties prop = new Properties();
		try {
			prop.load(Resources
					.getResourceAsStream("com/arsl/config.properties"));
			hostUrl = prop.getProperty(HOST_URL_KEY);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
